Add ia64 header for synch_bitops.h
authordjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Tue, 13 Sep 2005 19:08:00 +0000 (13:08 -0600)
committerdjm@kirby.fc.hp.com <djm@kirby.fc.hp.com>
Tue, 13 Sep 2005 19:08:00 +0000 (13:08 -0600)
linux-2.6-xen-sparse/include/asm-xen/asm-ia64/synch_bitops.h [new file with mode: 0644]

diff --git a/linux-2.6-xen-sparse/include/asm-xen/asm-ia64/synch_bitops.h b/linux-2.6-xen-sparse/include/asm-xen/asm-ia64/synch_bitops.h
new file mode 100644 (file)
index 0000000..9ad2d1f
--- /dev/null
@@ -0,0 +1,59 @@
+#ifndef __XEN_SYNCH_BITOPS_H__
+#define __XEN_SYNCH_BITOPS_H__
+
+/*
+ * Copyright 1992, Linus Torvalds.
+ * Heavily modified to provide guaranteed strong synchronisation
+ * when communicating with Xen or other guest OSes running on other CPUs.
+ */
+
+#include <linux/config.h>
+
+#define ADDR (*(volatile long *) addr)
+
+static __inline__ void synch_set_bit(int nr, volatile void * addr)
+{
+       set_bit(nr, addr);
+}
+
+static __inline__ void synch_clear_bit(int nr, volatile void * addr)
+{
+       clear_bit(nr, addr);
+}
+
+static __inline__ void synch_change_bit(int nr, volatile void * addr)
+{
+       change_bit(nr, addr);
+}
+
+static __inline__ int synch_test_and_set_bit(int nr, volatile void * addr)
+{
+    return test_and_set_bit(nr, addr);
+}
+
+static __inline__ int synch_test_and_clear_bit(int nr, volatile void * addr)
+{
+    return test_and_clear_bit(nr, addr);
+}
+
+static __inline__ int synch_test_and_change_bit(int nr, volatile void * addr)
+{
+    return test_and_change_bit(nr, addr);
+}
+
+static __inline__ int synch_const_test_bit(int nr, const volatile void * addr)
+{
+    return test_bit(nr, addr);
+}
+
+static __inline__ int synch_var_test_bit(int nr, volatile void * addr)
+{
+    return test_bit(nr, addr);
+}
+
+#define synch_test_bit(nr,addr) \
+(__builtin_constant_p(nr) ? \
+ synch_const_test_bit((nr),(addr)) : \
+ synch_var_test_bit((nr),(addr)))
+
+#endif /* __XEN_SYNCH_BITOPS_H__ */